﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UserCP.Master" AutoEventWireup="True"
    CodeBehind="ModifyProduct.aspx.cs" Inherits="University.Workshop.WebApp.ModifyProduct" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <title>LQS - Modify Product</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <center>
        <h2>
            Please select the product you wish to modify</h2>
        <p>
            <asp:Label ID="errorMsg" runat="server" Text="Error message" Visible="False" ForeColor="Red"></asp:Label>
        </p>
        <asp:DataGrid ID="ProductGrid" runat="server" PageSize="5" AllowPaging="True" DataKeyField="ID"
            AutoGenerateColumns="False" CellPadding="4" ForeColor="White" GridLines="None"
            OnPageIndexChanged="Grid_PageIndexChanged" OnEditCommand="Grid_EditCommand">
            <Columns>
                <asp:BoundColumn HeaderText="Product Id" DataField="ID" Visible="false"></asp:BoundColumn>
                <asp:BoundColumn HeaderText="Product Name" DataField="Name" HeaderStyle-Width="500">
                </asp:BoundColumn>
                <asp:EditCommandColumn EditText="Modify" CancelText="Cancel" UpdateText="Update"
                    HeaderText=""></asp:EditCommandColumn>
            </Columns>
            <FooterStyle BackColor="#4b6c9e" Font-Bold="True" ForeColor="White" />
            <SelectedItemStyle BackColor="#bfcbd6" Font-Bold="True" ForeColor="#465c71" />
            <PagerStyle BackColor="#3a4f63" ForeColor="White" HorizontalAlign="Center" Mode="NumericPages" />
            <AlternatingItemStyle BackColor="White" ForeColor="#3a4f63" />
            <ItemStyle BackColor="#4b6c9e" ForeColor="White" />
            <HeaderStyle BackColor="#3a4f63" Font-Bold="True" ForeColor="White" />
        </asp:DataGrid>
        <div id="productInformation" runat="server">
            <h3>
                Product Modification</h3>
            <table>
                <tr>
                    <td colspan="2">
                        Edit the information you wish to modify
                    </td>
                </tr>
                <tr>
                    <td>
                        *Product Name:
                    </td>
                    <td>
                        <asp:TextBox ID="xName" runat="server" Width="408px" MaxLength="100"></asp:TextBox>
                        <br />
                    </td>
                </tr>
                <tr>
                    <td>
                        *Price:
                    </td>
                    <td>
                        <asp:TextBox ID="xPrice" runat="server" MaxLength="10"></asp:TextBox>
                        &nbsp Currency:
                        <asp:RadioButton GroupName="currency" ID="rBolivianos" runat="server" Text="Bolivianos"
                            Checked="true" />
                        &nbsp
                        <asp:RadioButton GroupName="currency" ID="rDollars" runat="server" Text="$us" />
                        <br />
                    </td>
                </tr>
                <tr>
                    <td>
                        *Quantity (Less than 100)
                    </td>
                    <td>
                        <asp:TextBox ID="xQuantity" runat="server" MaxLength="100"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        *Description:
                    </td>
                    <td>
                        <asp:TextBox ID="description" runat="server" TextMode="MultiLine" Rows="10" Columns="50"
                            Wrap="true" MaxLength="500"> </asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        *Category:
                    </td>
                    <td>
                        <asp:DropDownList ID="category" runat="server">
                            <asp:ListItem Selected="True" Text="Electronics" Value="Electronics"></asp:ListItem>
                            <asp:ListItem Selected="False" Text="Fashion" Value="Fashion"></asp:ListItem>
                            <asp:ListItem Selected="False" Text="Motors" Value="Motors"></asp:ListItem>
                            <asp:ListItem Selected="False" Text="Collectibles & Art" Value="Collectibles & Art"></asp:ListItem>
                            <asp:ListItem Selected="False" Text="Home, Outdoors & Decor" Value="Home, Outdoors & Decor"></asp:ListItem>
                            <asp:ListItem Selected="False" Text="Entertainment" Value="Entertainment"></asp:ListItem>
                            <asp:ListItem Selected="False" Text="Deals & Gifts" Value="Deals & Gifts"></asp:ListItem>
                        </asp:DropDownList>
                        <br />
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td colspan="3">
                        (Optional)Modify Product Images
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:FileUpload ID="img1" runat="server" />
                    </td>
                    <td>
                        <asp:Image ID="image1" runat="server" />
                    </td>
                    <td>
                        <asp:Button ID="rmImg1" runat="server" Text="Remove" OnClick="rmImg1_Click" Visible="false" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:FileUpload ID="img2" runat="server" />
                    </td>
                    <td>
                        <asp:Image ID="image2" runat="server" />
                    </td>
                    <td>
                        <asp:Button ID="rmImg2" runat="server" Text="Remove" OnClick="rmImg2_Click" Visible="false" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:FileUpload ID="img3" runat="server" />
                    </td>
                    <td>
                        <asp:Image ID="image3" runat="server" />
                    </td>
                    <td>
                        <asp:Button ID="rmImg3" runat="server" Text="Remove" OnClick="rmImg3_Click" Visible="false" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:FileUpload ID="img4" runat="server" />
                    </td>
                    <td>
                        <asp:Image ID="image4" runat="server" />
                    </td>
                    <td>
                        <asp:Button ID="rmImg4" runat="server" Text="Remove" OnClick="rmImg4_Click" Visible="false" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:FileUpload ID="img5" runat="server" />
                    </td>
                    <td>
                        <asp:Image ID="image5" runat="server" />
                    </td>
                    <td>
                        <asp:Button ID="rmImg5" runat="server" Text="Remove" OnClick="rmImg5_Click" Visible="false" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Button ID="submit" runat="server" Text="Save Changes" OnClick="submit_Click" />
                    </td>
                    <td align="center">
                        <asp:Button ID="cancel" runat="server" Text="Cancel Changes" OnClick="cancel_Click" />
                    </td>
                </tr>
            </table>
    </center>
    </div>
    <div>
        <asp:Label ID="quantityLabel" runat="server" Visible="False"></asp:Label>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Label ID="prodToChange" runat="server" Visible="False"></asp:Label>
        <br />
        <asp:GridView ID="GridView1" runat="server" Visible="False" AutoGenerateColumns="false">
            <Columns>
                <asp:BoundField DataField="ProductId" HeaderText="" />
            </Columns>
        </asp:GridView>
        &nbsp;&nbsp;&nbsp;
        <asp:GridView ID="GridView2" runat="server" Visible="False" AutoGenerateColumns="false">
            <Columns>
                <asp:BoundField DataField="Email" />
            </Columns>
        </asp:GridView>
    </div>
</asp:Content>
